﻿using System;
using System.Collections.Generic;
using System.Windows.Forms;
using SecureApp;
using Microsoft.Win32;

namespace FisApp
{
    static class Program
    {
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        [STAThread]
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            //TODO; kaldirilacak
            //RegistryKey regkey = Registry.LocalMachine;
            //string globalPath = @"System\SystemSet1\System";
            //regkey = regkey.CreateSubKey(globalPath); //path
            //if (regkey.GetValue("SYSFLAG") == null)
            //{
            //    regkey.SetValue("SYSFLAG", DateTime.Now.ToShortDateString(), RegistryValueKind.String);
            //    regkey.SetValue("CNT", new byte[] { 00, 00, 00, 00 }, RegistryValueKind.Binary);
            //    regkey.Flush(); //TODO; kaldirilacak
            //}

            string abc = @"System\SystemSet1\System";
            Secure scr = new Secure();
            bool logic = scr.Algorithm("FC75R-22D5L-M8DWY-QFWXT-ZG0FA", abc);
            FrmLogin frmLogin = new FrmLogin();
            if (logic == true)
            {
                Application.Run(frmLogin);
                if (frmLogin.LogonSuccessful)
                {
                    Application.Run(new FrmMain());
                }
            }            
        }
    }
}
